home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / Src / Ch7 / ShowFilt.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-04-28  |  3.0 KB  |  96 lines

  1. VERSION 5.00
  2. Begin VB.Form frmShowFilter 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Filter Coefficients"
  5.    ClientHeight    =   1545
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2730
  9.    ControlBox      =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "Courier New"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    LinkTopic       =   "Form1"
  20.    ScaleHeight     =   1545
  21.    ScaleWidth      =   2730
  22.    ShowInTaskbar   =   0   'False
  23.    StartUpPosition =   3  'Windows Default
  24.    Begin VB.CommandButton cmdClose 
  25.       Cancel          =   -1  'True
  26.       Caption         =   "Close"
  27.       Default         =   -1  'True
  28.       BeginProperty Font 
  29.          Name            =   "MS Sans Serif"
  30.          Size            =   8.25
  31.          Charset         =   0
  32.          Weight          =   400
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   495
  38.       Left            =   720
  39.       TabIndex        =   0
  40.       Top             =   840
  41.       Width           =   1215
  42.    End
  43.    Begin VB.TextBox txtFilter 
  44.       BackColor       =   &H00C0C0C0&
  45.       Height          =   495
  46.       Left            =   120
  47.       Locked          =   -1  'True
  48.       MultiLine       =   -1  'True
  49.       TabIndex        =   1
  50.       TabStop         =   0   'False
  51.       Top             =   120
  52.       Width           =   1215
  53.    End
  54. Attribute VB_Name = "frmShowFilter"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. Option Explicit
  60. ' Prepare the form to display the kernel.
  61. Public Sub PrepareForm(kernel() As Single)
  62. Dim bound As Integer
  63. Dim i As Integer
  64. Dim j As Integer
  65. Dim txt As String
  66. Dim wid As Single
  67. Dim hgt As Single
  68.     bound = UBound(kernel, 1)
  69.     ' Make a string holding the coefficients.
  70.     For i = -bound To bound
  71.         For j = -bound To bound
  72.             txt = txt & " " & Format$(kernel(i, j), "0.000000") & " "
  73.         Next j
  74.         txt = txt & vbCrLf
  75.     Next i
  76.     txt = Left$(txt, Len(txt) - Len(vbCrLf))
  77.     ' Size the TextBox.
  78.     txtFilter.Text = txt
  79.     wid = TextWidth(txt) + 120
  80.     hgt = TextHeight(txt) + 120
  81.     txtFilter.Move 120, 120, wid, hgt
  82.     ' Size the form and position the Close button.
  83.     If txtFilter.Width > cmdClose.Width Then
  84.         Width = txtFilter.Width + 2 * 120 + Width - ScaleWidth
  85.     Else
  86.         Width = cmdClose.Width + 2 * 120 + Width - ScaleWidth
  87.     End If
  88.     Height = txtFilter.Height + cmdClose.Height + 3 * 120 + Height - ScaleHeight
  89.     cmdClose.Move _
  90.         (ScaleWidth - cmdClose.Width) / 2, _
  91.         txtFilter.Height + 2 * 120
  92. End Sub
  93. Private Sub cmdClose_Click()
  94.     Unload Me
  95. End Sub
  96.